<?
include_once('conn.php');
include_once('include/func.php');
include("admin_check.php") ;
if($admin[0][2]<>10){exit('<script>alert("您没有权限"); window.history.back(-1);</script>');}
?>	
<?
if($_POST){
	array_pop($_POST);
	//print_r($_POST);
	foreach($_POST as $k => $v){
		$v=htmlspecialchars($v, ENT_QUOTES);
		$key=substr($k,2);
		if($key==10 or $key==14 or $key==33 or $key==34){$var = explode_implode_array(2,$v);}else{$var = $v;}
		$db->UPDATE("UPDATE `".tablepre."config` SET `value`='".$var."' WHERE (`id`='".$key."')");
		
		}
	header("Location: $nowpage?ok");
	exit();	
	}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title><? echo systemname;?></title>
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
<link href="css/admin.css" rel="stylesheet" type="text/css" />
	<!-- jquery packed -->
	<script type="text/javascript" src="js/jquery-1.4.4.js"></script>
    <script type="text/javascript" src="js/dtree.js"></script>
        	<script type="text/javascript" src="fck/ckeditor.js"></script>
	<script src="fck/fck.js" type="text/javascript"></script>
	<link href="fck/css.css" rel="stylesheet" type="text/css" />
	<!-- tableRowCheckboxToggle -->
	<script type="text/javascript" src="js/tableRowCheckboxToggle.js"></script>
    <script type="text/javascript"> 
    function fade() 
{ 
    //停留2秒后消失,在停留的时候,透明度为1.0什么都不做 
    $('<div id="add" class="quick-alert">操作成功</div>').insertAfter($("#example")).animate({opacity: 1.0}, 2000).fadeOut("slow",function(){ 
   //隐藏时把元素删除 
   $(this).remove(); 
}); 
} 
</script> 

</head>
<body <? echo isset($_GET[ok])?'onload="fade();"':''; ?>>
<div id="wrap">
<div id="main" class="clearfix">
<div id="side">
  </div>
  <div id="head"><? include_once('admin_head.php');?></div>
  <div id="left"><?
  include_once('admin_menu.php');
  ?></div>
  <div id="right">
<div id="example"> </div>
<form id="form2" name="form2" method="post" action="">
<table width="600" border="0" cellspacing="2" cellpadding="2">
  <tr>
    <td align="right" bgcolor="#666666">&nbsp;</td>
    <td bgcolor="#666666" style="color:#FFF;">网站信息设定</td>
  </tr>
  <tr>
    <td align="right" bgcolor="#F3F3F3">网址</td>
    <td bgcolor="#F3F3F3"><input name="id7" type="text" value="<? echo parameters($con1=7); ?>"  />      
      最后不要加 /</td>
  </tr>
  <tr>
    <td align="right">系统安装目录</td>
    <td><input name="id22" type="text" value="<? echo parameters($con1=22); ?>"  /></td>
  </tr>
  <tr>
    <td align="right" bgcolor="#F3F3F3">公司名</td>
    <td bgcolor="#F3F3F3"><input type="text" name="id8" value="<? echo parameters($con1=8); ?>" /></td>
  </tr>
  <tr>
    <td align="right" bgcolor="#666666">&nbsp;</td>
    <td bgcolor="#666666" style="color:#FFF;">缩略图设定</td>
  </tr>
  <tr>
    <td align="right" bgcolor="#F3F3F3">缩略图模式</td>
    <td bgcolor="#F3F3F3"><select name="id5" >
    <?
    echo parameters($con1=8)==0?'<option value="0">自动截取</option>':'<option value="1">自定义大小</option>';
	?>
      <option value="0">自动截取</option>
      <option value="1">自定义大小</option>
    </select></td>
  </tr>
  <tr>
    <td align="right">自定义缩略图尺寸</td>
    <td><input type="text" name="id6" value="<? echo parameters($con1=6); ?>" />
      宽,长</td>
  </tr>
  <tr>
    <td align="right" bgcolor="#666666">&nbsp;</td>
    <td bgcolor="#666666" style="color:#FFF;">货币/货运设定</td>
  </tr>
  <tr>
    <td align="right" bgcolor="#F3F3F3">价钱四舍五入设置</td>
    <td bgcolor="#F3F3F3"><input type="text" name="id9" value="<? echo parameters($con1=9); ?>" />
      0为没有小数，输入2则显示两位小数</td>
  </tr>
  <tr>
    <td align="right">货币单位</td>
    <td><input type="text" name="id4" value="<? echo parameters($con1=4); ?>" /></td>
  </tr>
   <tr>
    <td align="right" bgcolor="#F3F3F3">商品单位</td>
    <td bgcolor="#F3F3F3"><input type="text" name="id24" value="<? echo parameters($con1=24); ?>" /></td>
  </tr>
  <tr>
    <td align="right">货币位置</td>
    <td><select name="id11">
        <?
    echo parameters(11)==0?'<option value="0">前</option>':'<option value="1">后</option>';
	?>
      <option value="0">前</option>
      <option value="1">后</option>
    </select></td>
  </tr>
  <tr>
    <td align="right" bgcolor="#F3F3F3">货运公司设置</td>
    <td bgcolor="#F3F3F3"><input name="id10" type="text" value="<?
	 echo explode_implode_array(1,''.parameters($con1=10).''); ?>" size="45" />
      用,号分隔</td>
  </tr>
  <tr>
    <td align="right" bgcolor="#666666">&nbsp;</td>
    <td bgcolor="#666666" style="color:#FFF;">显示/限制设置</td>
  </tr>
    <tr bgcolor="#F3F3F3">
      <td align="right">数量显示</td>
      <td><input name="id13" type="text"  value="<? echo parameters($con1=13); ?>" size="4" />
        当数量大于此数值后，将显示为约摸数</td>
    </tr>
    <tr >
      <td align="right" >库存报警数量设置</td>
      <td ><input name="id20" type="text"  value="<? echo parameters($con1=20); ?>" size="4" />
        库存数量少于此报警[0为不警告]</td>
    </tr>
       <tr >
      <td align="right" bgcolor="#F3F3F3" >订单超时时间</td>
      <td bgcolor="#F3F3F3" ><input name="id23" type="text"  value="<? echo parameters($con1=23); ?>" size="4" />
        订单超时不付款则退还商品[单位:小时][0为不限制]</td>
    </tr>
          <tr >
            <td align="right" >应补货</td>
            <td ><select name="id26">
        <?
    echo parameters(26)==0?'<option value="0">不显示</option>':'<option value="1">显示</option>';
	?>
      <option value="0">不显示</option>
      <option value="1">显示</option>
    </select></td>
          </tr>
          <tr >
      <td align="right" bgcolor="#F3F3F3" >合理库存</td>
      <td bgcolor="#F3F3F3" ><input name="id25" type="text"  value="<? echo parameters($con1=25); ?>" size="4" />
        计算方式为上月销售额的倍数[0为不显示]</td>
    </tr>
              <tr >
      <td align="right">打印页字体大小</td>
      <td><input name="id31" type="text"  value="<? echo parameters($con1=31); ?>" size="4" />
        字体太大会造成排版混乱[默认12]</td>
    </tr>
                  <tr >
      <td align="right" bgcolor="#F3F3F3">每页显现物品数</td>
      <td bgcolor="#F3F3F3"><input name="id33" type="text"  value="<? echo explode_implode_array(1,''.parameters($con1=33).''); ?>" />
        用,号分隔，仅限客户端</td>
    </tr>
                  <tr >
      <td align="right">价格查询条件</td>
      <td><input name="id34" type="text"  value="<? echo explode_implode_array(1,''.parameters($con1=34).''); ?>" />
        用,号分隔，仅限客户端[不能输入空格，大于时在数字前加 '&gt;']</td>
    </tr>
    <tr>
      <td align="right" bgcolor="#666666">&nbsp;</td>
      <td bgcolor="#666666"style="color:#FFF;">仓库管理</td>
    </tr>
    <tr>
      <td align="right">仓库管理</td>
      <td><input name="id14" type="text" value="<? echo explode_implode_array(1,''.parameters($con1=14).''); ?>" size="45" />
        用,号分隔</td>
    </tr>
    <tr >
      <td align="right" bgcolor="#666666">&nbsp;</td>
      <td bgcolor="#666666"style="color:#FFF;">Email 设置[必须正确设置后才能使用如取回密码之类的功能]</td>
    </tr>
    <tr>
      <td align="right" bgcolor="#F3F3F3">Email地址</td>
      <td bgcolor="#F3F3F3"><input name="id15" type="text" id="textfield" value="<? echo parameters($con1=15); ?>" /></td>
    </tr>
    <tr>
      <td align="right">Email smtp</td>
      <td><input name="id16" type="text" id="textfield4" value="<? echo parameters($con1=16); ?>" /></td>
    </tr>
    <tr>
      <td align="right" bgcolor="#F3F3F3">Email 密码</td>
      <td bgcolor="#F3F3F3"><input name="id17" type="password" id="textfield5" value="<? echo parameters($con1=17); ?>" /></td>
    </tr>    <tr >
      <td align="right" bgcolor="#666666">&nbsp;</td>
      <td bgcolor="#666666"style="color:#FFF;">公告</td>
    </tr>
    <tr>
      <td align="right">&nbsp;</td>
      <td>  <textarea cols="80" id="editor1" name="id19" rows="10" ><? echo parameters(19);?></textarea>
  		<script type="text/javascript">
		//<![CDATA[

			// Replace the <textarea id="editor"> with an CKEditor
			// instance, using default configurations.
			CKEDITOR.replace( 'editor1',
				{
					toolbar :
					[
						[ 'Bold', 'Italic', '-', 'NumberedList', 'BulletedList', '-', 'Link', 'Unlink' ]
					]
				});

		//]]>
		</script><br /></td>
    </tr>

</table>
<input type="submit" name="button2" id="button2" value="提交" />
</form></div>
  </div>
  </div>

<div id="footer">
<?
include_once('fooder.php');
?>
</div>
</BODY>
</HTML>
